<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>prevent default</title>
	</head>
	<body>
		<a href="http://www.hebtu.edu.cn">河北师范大学</a>
		<form action="http://www.haosou.com">
			username:<input type="text" id="username"/>
			password:<input type="password" id="pwd"/>
			<button>submit</button>
		</form>
		<script>
			document.querySelector('a').addEventListener('click',function(e){
				e.preventDefault();
			});
			document.querySelector('form').addEventListener('submit',function(e){
				e.preventDefault();
			});
		</script>
	</body>
</html>